﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;

namespace SchEdu.Framework.DataModel
{
    public class MachineKey : IComparable
    {
        SchEduDataSet.MachineRow machine = null;

        public int WorkCenterID
        {
          get { return machine.WorkCenterID; }
        }

        public int MachineID
        {
            get { return machine.ID; }
        }


        public MachineKey(SchEduDataSet.MachineRow machine)
        {
            this.machine = machine;
        }

        #region IComparable Members

        public int CompareTo(object obj)
        {
            MachineKey key = obj as MachineKey;
            if (key == null)
            {
                throw new ArgumentException("Object is not MachineKey");
            }
            if (this.machine.WorkCenterID < key.WorkCenterID)
            {
                return -1;
            }
            if (this.machine.WorkCenterID > key.WorkCenterID)
            {
                return 1;
            }
            if (this.machine.ID < key.MachineID)
            {
                return -1;
            }
            if (this.machine.ID > key.MachineID)
            {
                return 1;
            }
            return 0;
        }

        #endregion
    }

    class MachineOperationList : Dictionary<MachineKey,OperationList>
    {
    }
}
